package com.eshipenet.shipnet.edgechannelbuilder

import play.api.libs.json.{Format, Json}

object EdgeBoxChannel {
  implicit val format: Format[EdgeBoxChannel] = Json.format[EdgeBoxChannel]
}

case class EdgeBoxChannel(name: String)

object EdgeBox {

  implicit val format: Format[EdgeBox] = Json.format[EdgeBox]

}

case class EdgeBox(id: String, channels: Set[EdgeBoxChannel]) {

  def globalChannels(): Iterable[EdgeChannel] =
    channels.map { ch =>
      EdgeChannel(id = s"id/${ch.name}", name = ch.name)
    }

}
